#!/bin/bash
#cobbler 帮助菜单
basepath=$(cd `dirname $0`; pwd)
function menu ()
{
 cat << EOF
-----------------------------------------------
|**************koan for centos7 菜单**********|
-----------------------------------------------
`echo -e "\033[47;30m 可以在任意选择界面按"Ctrl+c"键退出\033[0m"`
`echo -e "\033[47;30m 1)安装koan\033[0m"`
`echo -e "\033[47;30m 2)查看cobbler的pfofile\033[0m"`
`echo -e "\033[47;30m 3)重启后开始安装系统\033[0m"`
`echo -e "\033[47;30m 4)\033[0m"`
`echo -e "\033[47;30m 5)\033[0m"`
`echo -e "\033[47;30m 6)\033[0m"`
`echo -e "\033[47;30m 7)\033[0m"`
`echo -e "\033[47;30m 8)\033[0m"`
`echo -e "\033[47;30m 9)reboot\033[0m"`
`echo -e "\033[47;30m 0)退出\033[0m"`
EOF
read -p "请输入功能对应的数字：" num1
while [ $num1 != '0' ];do
case $num1 in
 1)
   clear
   yum install -y koan
   menu
   ;;
 2)
   clear
   read -p "输入Cobbler服务器IP:" host
   koan -s $host -l profiles
   menu
   ;;
 3)
   clear
   read -p "输入Cobbler服务器IP:" host
   koan -s $host -l profiles
   read -p "输入profile:" profile
   koan -r s $host -p $profile
   
   menu
   ;;
 4)
   clear

   menu
   ;;
 5)
   clear

   menu
   ;;
 6)
   clear
   menu
   ;;
 7)
   menu
   ;;
 8)
   clear
   read -s -n1 -p "按任意键继续 ... "
   menu
   ;;
 9)
   clear
   reboot
   menu
   ;;
 0)
   exit 0
esac
done
}
menu

